// 1.引入创建路由需要的组件
import { createRouter, createWebHistory } from 'vue-router'
import Footer from '@/views/main/Footer.vue';

// 2.配置系统所有路由页面，浏览器通过path路径加载对应组件
const routes = [
    { path: '/main', component: () => import('@/views/main.vue') 
        , children: [
            { path: '/main/homepage', component: () => import('@/views/main/homepage.vue') },
            { path: '/main/series', component: () => import('@/views/main/series.vue') },
            { path: '/main/order', component: () => import('@/views/main/order.vue') },
            { path: '/main/introduction', component: () => import('@/views/main/introduction.vue') },
            { path: '/main/recruitment', component: () => import('@/views/main/recruitment.vue') },
            { path: '/main/contact', component: () => import('@/views/main/contact.vue') },
        ]
    },
    { path: '/', redirect: '/main/homepage' }
]

// 3.创建路由实例
const router = createRouter({
    history: createWebHistory(), //使用history模式，hash模式使用 createWebHashHistory() 方法
    routes
})

// 4.声明,为路由提供外部引用的入口
export default router

